//******************************************************************************
// @File: cyzPreimaryGeneratorAction.cc
// @Author: Cyz
// @Date: 2020年 5月 1日 星期五 21时18分56秒 CST
// @Description: 
//		Implementation of the cyzPrimaryGeneratorAction
//		Implement a Particle Gun
//******************************************************************************

#include "cyzPrimaryGeneratorAction.hh"

//#include "G4LogicalVolumeStore.hh"
//#include "G4LogicalVolume.hh"
//#include "G4Box.hh"
#include "G4RunManager.hh"  //<<--------------WHY: Do we need this?
#include "G4GeneralParticleSource.hh"
#include "G4SystemOfUnits.hh"
//#include "Randomize.hh"

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

cyzPrimaryGeneratorAction::cyzPrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
  gps(0) 
{	
	/********  Particle Source of GPS  ********/
	gps = new G4GeneralParticleSource();
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

cyzPrimaryGeneratorAction::~cyzPrimaryGeneratorAction()
{
  delete gps;
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void cyzPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
  //this function is called at the begining of ecah event
  //
	//Doing the least thing, remain them to macro file/commands
	//
  gps->GeneratePrimaryVertex(anEvent);
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

